package com.baidu.ueditor;
/**
 * 封装替换分页标识符的类  默认 _ueditor_page_break_tag_
 * @author sven yu
 * 
 * **/
public class PageTagUtils {
	
	public static String tag="_ueditor_page_break_tag_";
	public static String taghtml="<hr/>";
//	public static String taghtml="<hr id='pageTag' style='height:2px;border:none;' />";
//	public static String taghtml="<div style='margin:0;padding:0; width:100%;height:2px;background-color:#9A9A9A;overflow:hidden;margin-top: 15px;'></div>";
	
	/***
	 * 默认替换
	 * 
	 * **/
	public static String replace(String content){
		if(null==content||"".equals(content))return content;
		return content.replace(tag, taghtml);
	}
	
	/***
	 * 传入标识替换
	 * 
	 * **/
	public static String replace(String tag,String content){
		if(null==content||"".equals(content))return content;
		return content.replace(tag, taghtml);
	}
	
	/***
	 * 传入标识及替换内容替换
	 * 
	 * **/
	public static String replace(String tag,String taghtml,String content){
		if(null==content||"".equals(content))return content;
		return content.replace(tag, taghtml);
	}
	
	public static void main(String[] args) {
		String c="<p>1</p>_ueditor_page_break_tag_<p>22222</p><hr/><p>333<br/></p>";
		System.out.println(replace(c));
	}

}
